// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Mint from 'mint-ui';
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import MuseUI from 'muse-ui'
import 'muse-ui/dist/muse-ui.css'

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(MuseUI)


// Vue.prototype.userBaseUrl = "https://bird.ioliu.cn/";//登录
// axios.defaults.baseURL = 'https://bird.ioliu.cn'  // 设置请求地址，后面的接口都将基于这个基本请求地址

// 设置请求头
axios.defaults.headers.put['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.patch['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

//如果在发送来自其他域的XMLHttpRequest请求之前，未设置withCredentials 为true，那么就不能为它自己的域设置cookie值。而通过设置withCredentials 为true获得的第三方cookies，将会依旧享受同源策略
//axios 默认不发送cookie，这样设置可以保存登陆成功的token和cid在cookie中
// axios.defaults.withCredentials = true
//封装axios
const instance = axios.create({
  baseURL: 'https://bird.ioliu.cn/',
  timeout: 10000,
  withCredentials: true,//跨域
});
Vue.prototype.axios = instance;

Vue.use(Mint);
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})
